laravel exist

70

if (User::where('email', $request->email)->exists()) {
   //email exists in user table
}
$user = User::where('email', '=', Input::get('email'))->first();
if ($user === null) {
   // user doesn't exist
}
if (User::where('email', '=', Input::get('email'))->exists()) {
   // user found
}
if($user->isEmpty()){
    // has no records
}

Comments

Submit
0 Comments